<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="ee.graphicscard.model.dto.GraphicsCard"%>    
 
<jsp:useBean id="arrayOfGraphicsCards" scope="request" type="ee.graphicscard.model.dto.GraphicsCard[]" /> 
   
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>Insert title here</title>
	</head>
	<body>
		<a href='s'>servlet</a> | <a href='log.txt'>log.txt</a> <br>
		Graafikakaartide nimekiri:
		<br>
		<%
		
		//GraphicsCard graphicscards = (GraphicsCard) request.getAttribute("graphicscards");	
		
		
			String graphicscard_id = "";
			String product_name = "";
			String cudacores = "";
			String overview = "";
		%>			
		<table bgcolor='#000000' border=0 cellpadding=0 cellspacing=0>
			<tr> 
				<td>
					<table width=100% border=0 cellpadding=2 cellspacing=1>
							<tr bgcolor='#cccccc'>
								<td>
									<strong>Identifikaator&nbsp;</strong>
								</td>
								<td>
									<strong>Toote&nbsp;nimi&nbsp;</strong>
								</td>
								<td>
									<strong>CUDA&nbsp;Cores&nbsp;arv&nbsp;</strong>
								</td>
								<td>
									<strong>......&nbsp;</strong>
								</td>
								<td>
									<strong>......&nbsp;</strong>
								</td> 
							</tr>
							<tr>
							</tr>
				
		<%
			try
			{
				for (int i = 0; i < arrayOfGraphicsCards.length ; i++)
				{
					graphicscard_id = Integer.toString(arrayOfGraphicsCards[i].getGraphicscard_id());
					product_name = arrayOfGraphicsCards[i].getProduct_name();
					cudacores = Integer.toString(arrayOfGraphicsCards[i].getCudacores()) ;
					overview = arrayOfGraphicsCards[i].getOverview();
		%>				
							<tr bgcolor='#FFFFFF'>
								<td nowrap>
									&nbsp; <%=graphicscard_id %>&nbsp;
								</td>
								<td>
									<%=product_name%>&nbsp;
								</td>
								<td>
									<%=cudacores%>&nbsp;
								</td>
								<td align='top' nowrap>
									<a href='s?id=<%=graphicscard_id%>' TARGET='_self'>
										<b><u>kirjeldus</u><b>
									</a>
								</td>
								<td align='top' nowrap>
									<a href='s?id=<%=graphicscard_id%>'><!-- enne oli parameetris ka korduvpäringu suunamine iseendale, mitte uuesti 
										servleti kätte, s.t.     TARGET='_self' -->
										<b><u>muuda</u><b>
									</a>
								</td>
							</tr>
		<%					
				}
			}
			catch (Exception ex)
			{
				out.println("Mingi viga" + ex.getMessage());
			}
		%>
		
					</table>
				</td>
			</tr>
		</table>
		</form>
	</body>
</html>